<include file="Public/head"/>
<link href="__PUBLIC__/layui/css/layui.css" rel="stylesheet" type="text/css" />
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
<style>
th{
    font-size:19px;
    color:#000;
}
#dao select{
    text-align: center;
}

table{
    height:700px;
    margin-top: 20px;
}
table td{
   font-size:16px;
}
#dao input{
    width:18px;
    height:18px;

    /*margin:0px 5px;*/ 
    /*padding: 0px 5px;*/
}

</style>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }

    </script>

    <include file="Public/sidebar"/>
   <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>
                    <div class="row">
                    <div class="col-xs-12">
                        <form id="form" method="post" action="{:U('pan')}" style="margin-top:2%;">
                        <table class="table table-bordered" >
                            <thead>
                                <tr>
                                    <th colspan="9" class="center warning" style="color:#000;font-size:30px;"> 绩效考核表</th>
                                </tr>
                                <tr>
                                    <th class="center danger">角度</th>
                                    <th class="center danger">战略目标</th>
                                    <th class="center danger">衡量指标</th>
                                    <th class="center danger">权重</th>
                                    <th class="center danger">目标值</th>
                                    <th class="center danger">计分规则</th>
                                    <th class="center danger">数据来源</th>
                    
                                    <?php if($gwei == '0'): ?>
                                        <th class="center danger">考核人</th>
                                    <?php else: ?>
                                        <th class="center danger">考核岗位</th>
                                    <?php endif ?>
            
            
                                    
                                    <th class="center danger">评分人<br><b style="color:#f00;">(不选则为默认)</b></th>
                                </tr>
                            </thead>
                            <tbody>
                                <volist name="jlist" id="v">
                                <tr>
                                    <input type="hidden" name="pid[]" value="{$v.id}">
                                    <?php if($gwei == '0'): ?>
                                        <input type="hidden" name="uname" value="{$v.uname}">
                                    <?php else: ?>
                                        <input type="hidden" name="post" value="{$v.post}">
                                    <?php endif ?>
                                    
                                    <td class="center success" style="display:none;">{$v.e_time}</td>
                                    <td class="center success" style="display:none;">{$v.j_time}</td>
                                    <td class="center success" style="display:none;">{$v.post}</td>
                                    <td class="center success" style="display:none;">{$v.bu}</td>
                                    <td class="center success" style="display:none;">{$v.uname}</td>
                                    <td class="center success" style="display:none;">{$v.g_type}</td>
                                    <td class="center success" style="display:none;">{$v.m_type}</td>
                                    <td class="center success">{$v.angle}</td>
                                    <td class="center">{$v.target}</td>
                                    <td class="center">{$v.norm}</td>
                                    <td class="center">{$v.weight}%</td>
                                    <td class="center">
                                        <?php if(is_numeric($v['value'])): ?>
                                            {$v.value}%
                                        <?php else: ?>
                                            {$v.value}
                                        <?php endif ?>
                                    </td>
                                    <td class="center" style="width:25%;">{$v.rule}</td>
                                    <td class="center">{$v.num}</td>
                                    <!-- <td class="center">{$v.post}</td> -->
                                    <?php if($gwei == '0'): ?>
                                        <td class="center">{$v.uname}</td>
                                    <?php else: ?>
                                        <td class="center">{$v.post}</td>
                                    <?php endif ?>
                                    
                                    <td class="center" style="display:none;">{$v.yue}</td>
                                    <?php if(empty($v['pname'])): ?>
                                        <td class="center"><a onclick="dui({$v.id},this)" class="layui-btn layui-btn-normal">选择评分人</a></td>
                                    <?php else: ?>
                                        <td class="center"><b style="color:#28FF28">√已选择评分人</b></td>
                                    <?php endif ?>
                                </tr>  
                                </volist>
                                <tr>
                                    <td colspan="9" class="center"><button class="btn-info" style="width:100px;height:30px;font-size:17px;" onclick="que()">确定</button></td>
                                </tr>
                            </tbody>
                        </table>
                        </form>
 
                    </div>
                    </div>

                    <div id="dao" style="display:none;">
                            <div class="checkbox" style="margin-left:20px;">
                                <form action="" id="xform">
                                    <input type="hidden" name="ment"   id="ment">
                                    <input type="hidden" name="uname"  id="uname">
                                    <input type="hidden" name="g_type" id="g_type">
                                    <input type="hidden" name="m_type" id="m_type">
                                    <input type="hidden" name="pid"    id="id">
                                    <input type="hidden" name="angle"  id="angle">
                                    <input type="hidden" name="target" id="target">
                                    <input type="hidden" name="norm"   id="norm">
                                    <input type="hidden" name="weight" id="weight">
                                    <input type="hidden" name="value"  id="value">
                                    <input type="hidden" name="rule"   id="rule">
                                    <input type="hidden" name="num"    id="num">
                                    <input type="hidden" name="post"   id="post">
                                    <input type="hidden" name="yue"    id="yue">
                                    <input type="hidden" name="j_time" id="j_time">
                                    <input type="hidden" name="e_time" id="e_time">

                                     <volist name="mlist" id="item" >
                                        <b style="font-size:18px;">{$key}  :</b>
                                        <volist name="item" id="v">
                                            <label>
                                                <input type="checkbox"  name="user[]" value="{$v.user}" ><span style="font-size:16px;" id="">{$v.user}</span>
                                                <!-- <input type="hidden" value="{$mlist}" id="pingname"> -->
                                            </label>&nbsp&nbsp&nbsp
                                        </volist>
                                        <br/>-------------------------<br>  
                                     </volist>
                               
                                     
                                </form>
                                <div style="margin-top:40%;margin-left:45%;background-color:#66B3FF;width:70px;text-align:center;height:30px;line-height:30px;border:1px solid #66B3FF;box-shadow: 3px 3px 10px #ADADAD;color:#fff;cursor:pointer;font-size:16px;" onclick="xuan()">确定</div>
                            </div>


                    </div>
                    
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<!-- <script src="__PUBLIC__/qwadmin/js/function.js"></script> -->
<script src="__PUBLIC__/layer/layer.js"></script>
<script type="text/javascript">
function dui(id,obj)
{
    // console.log(obj);
    // console.log(id);
    var yue = $(obj).parent().prev().text();
    // var post = $(obj).parent().prev().prev().text();
    var num = $(obj).parent().prev().prev().prev().text();
    var rule = $(obj).parent().prev().prev().prev().prev().text();
    var value = $(obj).parent().prev().prev().prev().prev().prev().text();
    var weight = $(obj).parent().prev().prev().prev().prev().prev().prev().text();
    var norm = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().text();
    var target = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().text();
    var angle = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().prev().text();
    var m_type = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().text();
    var g_type = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().text();
    var uname = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().text();
    var ment = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().text();
    var post = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().text();
    var j_time = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().text();
    var e_time = $(obj).parent().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().prev().text();
    // console.log(g_type);
    $('#angle').val(angle);
    $('#target').val(target);
    $('#norm').val(norm);
    $('#weight').val(weight);
    $('#value').val(value);
    $('#rule').val(rule);
    $('#num').val(num);
    $('#post').val(post);
    $('#yue').val(yue);
    $('#id').val(id);
    $('#m_type').val(m_type);
    $('#g_type').val(g_type);
    $('#uname').val(uname);
    $('#ment').val(ment);
    $('#j_time').val(j_time);
    $('#e_time').val(e_time);
    // $.ajax({
    //      type: "POST",
    //      url:"{:U('xuancha')}",
    //      data:{'uname':uname,'m_type':m_type,'target':target},// 要提交的表单 
    //      beforeSend:function(){
    //            layer.load(0, {shade: false});
    //         },
    //      success: function(data) {
            layer.open({
                type: 1,
                title:  ['对应人选择', 'font-size:17px;'],
                skin: 'demo-class', //加上边框
                area: ['1000px', '600px'], //宽高
                content: $('#dao'),
                // btn:'按钮'
            });
    //         var value = $('#pingname').val();
    //         console.log($('#pingname').val());

    //         // for (var i = 0; i < value.length; i++) {
    //         //     console.log(value[i].uname);
    //         //     // if (data == value) {
    //         //     //     $('#pingname').attr("checked","checked");
    //         //     // }
    //         // }
    //      },
    //      complete: function() {
    //              layer.closeAll('loading');
    //         }
    // });
    // console.log(uname);
    
}



function xuan()
{
    //询问框
    layer.confirm('确定选择么 ( ・◇・)？', {
      btn: ['确定','取消'] //按钮
    }, function(){
         $.ajax({
             type: "POST",
             url:"{:U('xuan')}",
             data:$('#xform').serialize(),// 要提交的表单 
             beforeSend:function(){
                   layer.load(0, {shade: false});
                },
             success: function(msg) {
                // console.log(msg);
                if (msg == 1111) {
                    layer.msg('添加成功~', {icon: 1});
                    history.go(0); 
                }else{
                    layer.msg('添加失败！', {icon: 2});
                }
             },
             complete: function() {
                     layer.closeAll('loading');
                }
         });
     
    }, function(){
        layer.msg(' (｡・`ω´･) 再见');
    });   
            
}



 function fan()
 {
   location.href="{:U('index')}";
 }
</script>
</body>
</html>



